package de.kraenksoft.android.cinemaExample.fakes;

import java.util.Calendar;
import java.util.GregorianCalendar;

import de.kraenksoft.android.cinemaExample.model.Movie;
import de.kraenksoft.android.cinemaExample.model.Screening;
import de.kraenksoft.android.cinemaExample.model.Theater;

public class FakeTheaterFactory {
	
	public static String MOVIENAME = "The Test Movie";
	public static String FIRSTTIME = "19:00";
	public static String SECONDTIME = "20:00";
	public static String THIRDTIME = "21:00";
	public static String MULTIPLETIMES = "19:00\n20:00\n21:00";
	
	public static Theater createTheaterScreeningsOnlyToday(){
		Theater theater = new Theater();
		Movie movie = new Movie();
		movie.setName(MOVIENAME);
		Calendar today = GregorianCalendar.getInstance();
		today.set(Calendar.HOUR_OF_DAY, 19);
		today.set(Calendar.MINUTE, 0);
		Screening screening = new Screening(today.getTime());
		movie.addScreening(screening);
		theater.add(movie);
		return theater;
	}
	
	public static Theater createTheaterScreeningsTwoDays(){
		Theater theater = new Theater();
		Movie movie = new Movie();
		movie.setName(MOVIENAME);
		Calendar today = GregorianCalendar.getInstance();
		today.set(Calendar.HOUR_OF_DAY, 19);
		today.set(Calendar.MINUTE, 0);
		Screening screening = new Screening(today.getTime());
		movie.addScreening(screening);
		today.add(Calendar.DAY_OF_YEAR, 1);
		today.set(Calendar.HOUR_OF_DAY, 20);
		screening = new Screening(today.getTime());
		movie.addScreening(screening);
		
		theater.add(movie);
		return theater;
	}
	
	public static Theater createTheaterScreeningsPastDays(){
		Theater theater = new Theater();
		Movie movie = new Movie();
		movie.setName(MOVIENAME);
		Calendar today = GregorianCalendar.getInstance();
		today.add(Calendar.DAY_OF_YEAR, -1);
		today.set(Calendar.HOUR_OF_DAY, 19);
		today.set(Calendar.MINUTE, 0);
		Screening screening = new Screening(today.getTime());
		movie.addScreening(screening);
		today.add(Calendar.DAY_OF_YEAR, -1);
		today.set(Calendar.HOUR_OF_DAY, 20);
		screening = new Screening(today.getTime());
		movie.addScreening(screening);
		
		theater.add(movie);
		return theater;
	}
	
	public static Theater createTheaterScreeningsEmtpyDayBetween(){
		Theater theater = new Theater();
		Movie movie = new Movie();
		movie.setName(MOVIENAME);
		Calendar today = GregorianCalendar.getInstance();
		today.set(Calendar.HOUR_OF_DAY, 19);
		today.set(Calendar.MINUTE, 0);
		Screening screening = new Screening(today.getTime());
		movie.addScreening(screening);
		today.add(Calendar.DAY_OF_YEAR, 2);
		today.set(Calendar.HOUR_OF_DAY, 21);
		screening = new Screening(today.getTime());
		movie.addScreening(screening);
		
		theater.add(movie);
		return theater;
	}
	
	public static Theater createTheaterScreeningsMultipleTimes(){
		Theater theater = new Theater();
		Movie movie = new Movie();
		movie.setName(MOVIENAME);
		Calendar today = GregorianCalendar.getInstance();
		today.set(Calendar.HOUR_OF_DAY, 19);
		today.set(Calendar.MINUTE, 0);
		Screening screening = new Screening(today.getTime());
		movie.addScreening(screening);
		today.set(Calendar.HOUR_OF_DAY, 20);
		screening = new Screening(today.getTime());
		movie.addScreening(screening);
		today.set(Calendar.HOUR_OF_DAY, 21);
		screening = new Screening(today.getTime());
		movie.addScreening(screening);
		theater.add(movie);
		return theater;
	}
	
}
